home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / network / ka9q / nhclb120.zoo / test_tick.c < prev    next >
C/C++ Source or Header  |  1992-02-18  |  416b  |  24 lines

  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include <sys/times.h>
  4.  
  5. /*
  6.  * Use this program to determine the proper value of MSPTICK for
  7.  * your system.
  8.  */
  9. main() {
  10.     long old, curr, times();
  11.     struct tms foo;
  12.     float f;
  13.  
  14.     old = times(&foo);
  15.     for (;;) {
  16.         sleep(1);
  17.         curr = times(&foo);
  18.         f = 1000.0/(float)(curr - old);
  19.         printf("%d actual value = %f, MSPTICK = %d\n", curr-old,
  20.  f, (int)(f + 0.5));
  21.         old = curr;
  22.     }
  23. }
  24.